import { createPinia } from 'pinia'
import { config } from '@/common/config'
const pinia = createPinia()
import useUserStore from './user'

const userStore = useUserStore(pinia)
userStore.$subscribe((mutation, state) => {
  uni.setStorageSync(config.storeName, state)
})
function getUserStoreData():void {
  const data = uni.getStorageSync(config.storeName)
  userStore.$patch(data)
}
getUserStoreData()
export default pinia
